<script setup>
import { ref } from "vue";
import { addTopicWhitelist } from "@/api/open";

const greetMsg = ref("");
const name = ref("");

async function fn_http () {
  // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
  try {
    const resp = await addTopicWhitelist()
    greetMsg.value = `add topic whitelist : ${resp.msg}  ${name.value} `
  } catch (err) {
    alert(JSON.stringify(err))

  }
}
</script>
<template>
  <div>
    <form class="row" @submit.prevent="fn_http">
      <input id="greet-input" v-model="name" placeholder="Enter a name..." />
      <button type="submit">Axios Http</button>
    </form>
    <p>{{ greetMsg }}</p>
  </div>
</template>
